package com.upay.android.client.adapter;

import java.util.List;

import android.app.Activity;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.upay.android.client.R;
import com.upay.domain.group.Group;
import com.upay.domain.payment.PaymentDetail;


public class PaymentArrayAdapter extends ArrayAdapter<PaymentDetail> {
	
	/* ---- Instance Variables ---- */
	private Activity context = null;
	private List<PaymentDetail> payments = null;

	/* ---- Constructors ---- */
	public PaymentArrayAdapter(Activity context, List<PaymentDetail> payments) {
		super(context, R.layout.exactuserrowlayout, payments);
		this.context = context;
		this.payments = payments;
	}
//	
//	/* ---- Business Methods ---- */
//	
//	@Override
//	public View getView(int position, View convertView, ViewGroup parent) {
//		View view = null;
//		
//		if (convertView == null) {
//			LayoutInflater inflator = context.getLayoutInflater();
//			view = inflator.inflate(R.layout.paymentrowlayout, null);
//			final ViewHolder viewHolder = new ViewHolder();
//			viewHolder.group = (TextView) view.findViewById(R.id.registered_group_row_group);
//			viewHolder.policy = (TextView) view.findViewById(R.id.registered_group_row_policy);
//			viewHolder.balance = (TextView) view.findViewById(R.id.registered_group_row_balance);
//			view.setTag(viewHolder);
//		} else {
//			view = convertView;
//		}
//		ViewHolder holder = (ViewHolder) view.getTag();
//		PaymentDetail paymentDetail = payments.get(position);
//		holder.group.setText(group.getName());
//		holder.group.setTextColor(Color.rgb(51, 181, 229));
//		//holder.group.setTextAppearan8ce(getContext(), android.R.style.TextAppearance_DeviceDefault_Large);
//		holder.group.setTextSize(18);
//		holder.policy.setText(group.getGroupPolicy().getName());
//		holder.balance.setText(group.getBalance() == null ? "0.00" : group.getBalance().toString());
//		return view;
//	}
//	
//
//	static class ViewHolder {
//		protected TextView group;
//		protected TextView policy;
//		protected TextView balance;
//	}


	/* ---- Getters and Setters ---- */

	/**
	 * @return the context
	 */
	public Activity getContext() {
		return context;
	}



	/**
	 * @param context the context to set
	 */
	public void setContext(Activity context) {
		this.context = context;
	}


	

	
	
	

}
